<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
</body>
<script>
    function DivTag() {
        this.DOM = document.createElement('div');  //先在本文档创建一个div元素
        this.__加到 = function (node) {      //node 节点
            node.appendChild(this.DOM);
        };
        this.__设置样式 = function (name,value) {
            this.DOM.style[name] = value;
        };
    }
    var divTag = new DivTag();
    divTag.__加到(document.body);
    divTag.__设置样式('border','1px solid red');
    divTag.__设置样式('width','400px');
    divTag.__设置样式('height','400px');
    divTag.__设置样式('backgroundColor','pink');
</script>
</html>